#ifndef _GRAPHICS_H_
#define _GRAPHICS_H_

#define NITRO_ENABLE_COLOR    0x8000
#define COLOR_RGBTO555(r,g,b) ((u16)(((b>>3)<<10) | ((g>>3)<<5) | (r>>3)))


class CGraphics
{
private:
	u16*	m_data;
	int		m_width;
	int		m_height;
	
	u16		m_color;
protected:
public:
	CGraphics(u16 *data, int width, int height);
	~CGraphics();
	
	
	void setColor(u16 color) {m_color = u16(color | NITRO_ENABLE_COLOR);}
	void setColor(u8 r, u8 g, u8 b) {m_color = COLOR_RGBTO555(r,g,b) | NITRO_ENABLE_COLOR;}
	u16  getColor() {return m_color & 0x7FFF;}
	
	void fillRect(int x, int y, int width, int height);
	void putPixel(int x, int y);
	void putPixel(int x, int y, u16 color);
	void putPixel(int x, int y, u8 r, u8 g, u8 b);
	u16 getPixel(int x, int y);
};

#endif //_GRAPHICS_H_